package servlet.huwenyao;

import pojo.Goods;
import pojo.Order;
import service.OrderService;
import service.impl.OrderServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(value = "/SeleAllWareServlet")
public class SeleAllWareServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/json;charset=UTF-8");
        String wareId=request.getParameter("str");
        OrderService orderService=new OrderServiceImpl();
        Goods goods=orderService.finaGoods(Integer.parseInt(wareId));
        request.setAttribute("goods",goods);
        request.getRequestDispatcher("jsp/hwy/InsePageOrder.jsp").forward(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
       doPost(request,response);
    }
}
